package com.isoft.demooa.dao;

import com.isoft.demooa.entity.Dept;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DeptMapper {

    @Select("select * from tb_department where id = #{deptId}")
    @Results(value = {
            @Result(column = "id",property = "deptId"),
            @Result(column = "deptname",property = "deptName")
    })
    Dept SelectById(Integer deptId);


    @Select("select * from tb_department")
    @Results(value = {
            @Result(column = "id",property = "deptId"),
            @Result(column = "deptname",property = "deptName"),
    })
    List<Dept> selectAll();
}
